<template>
        <a-form-item :label="config.label">
        <a-select  default-value="lucy" style="width: 320px"   v-model="form[config.prop]" @change="onChange" :placeholder="config.placeholder || '请选择'">
                  <a-select-option :value="item[config.labelKey]" v-for="item of config.dataSource"
        :key="item[config.valueKey]">
       {{item[config.labelKey]}}
      </a-select-option>
        </a-select>
    </a-form-item>
</template>
<script>
export default {
      name: 'FormSelect',
      props: {
    form: {
      type: Object,
      default: () => ({})
    },
    config: {
      type: Object,
      default: () => ({})
    },
    dataSource: {
      type: Array,
      default: () => []
    }
  },
    methods: {
    onChange() {
      this.$emit('change', this.form[this.config.prop], this.config)
    }
  }
}
</script>
<style scoped>
::v-deep .ant-form-item-control{
    text-align: left;
}
</style>